package cn.colins.producer.filter;

import org.apache.dubbo.common.constants.CommonConstants;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.Exporter;
import org.apache.dubbo.rpc.ExporterListener;
import org.apache.dubbo.rpc.RpcException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description
 * @Author czl
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2023/5/8
 */
@Activate(group = CommonConstants.PROVIDER)
public class MyExporterListener implements ExporterListener {
    private final static Logger log= LoggerFactory.getLogger(MyExporterListener.class);

    @Override
    public void exported(Exporter<?> exporter) throws RpcException {
        log.info("有服务暴露了:{} ",exporter.getInvoker().getUrl());
    }

    @Override
    public void unexported(Exporter<?> exporter) {
        log.info("有服务取消暴露了:{} ",exporter.getInvoker().getUrl());
    }
}
